package com.test.spring6;

import bean.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class firstD {
    @Test
    public void testFirst(){
        // 第一步 获取容器
        ApplicationContext applicationContext
                = new ClassPathXmlApplicationContext("spring.xml");
        // 第二步 根据id获取容器当中的对象
        User userBean = applicationContext.getBean("userBean", User.class);
        System.out.println(userBean);

    }
}
